<template>
  <div class="user-page">
<div class="box">
<img :src="avatar" alt="">
  <div class="con">{{ username }}</div>
</div>

<van-grid :column-num="3" :border="true" class="grid" >
  <van-grid-item icon="scan" text="历史记录" to="/collect"/>
  <van-grid-item icon="chat-o" text="收藏" to="/like"/>
  <van-grid-item icon="user-o" text="我的" />

</van-grid>
<van-cell title="推荐反馈" is-link />
<van-cell title="意见反馈" is-link />
<van-cell title="关于我们" is-link />
<van-cell title="推出登录" is-link @click="getTui"/>
  </div>
</template>

<script>
// import { getUpdataLikeApi } from '../api/user'
import { getUserApi, getTuiChuApi } from '@/api/user'

// import { delToken } from '@/utils/storage'
export default {
  name: 'UserPage',
  data () {
    return {
      avatar: '',
      username: ''
    }
  },
  async created () {
    const { data } = await getUserApi()
    this.avatar = data.avatar
    this.username = data.username
  },
  methods: {
    // logout () {
    //   // this.$router.push('/login')
    //   delToken()
    //   this.$toast.success('退出成功')
    // }

    getTui () {
      getTuiChuApi()
      // this.$router.push('/login')
    }
  }
}
</script>

<style lang="less" scoped>

.box{
display: flex;
align-items: center;
width: 100%;
height: 100px;
// background-color: antiquewhite;
margin-left: 30px;
img{
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 20px;
}
.con{
  font-size: 16px;
  font-weight: 750;
}
}
.grid{
  height: 100px;

}
</style>
